﻿class Solution {
    public int subtractProductAndSum(int n) {
        int ret1=1;
        int ret2=0;
    
while(n>0){
ret1*=n%10;
ret2+=n%10;
n/=10;
}
return ret1-ret2;
    }
}